<template>
  <div>
    <h3>百度翻译</h3>
    <el-form v-model="form" label-width="80px">
      <el-form-item label="APPid">
        <el-input v-model="form.appid" :disabled="true"></el-input>
      </el-form-item>
      <el-form-item label="密钥">
        <el-input v-model="form.key" :disabled="true"></el-input>
      </el-form-item>
      <el-form-item style="text-align: center">
        <el-button type="primary" @click="handleSave">保存</el-button>
        <el-button>取消</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
import api from "@/api/index";

export default {
  name: "BaiduApi",
  data() {
    return {
      form: {
        appid: "20220409001165196",
        key: "cXRYjyc76iqXWaaS0rhO",
      },
    };
  },
  methods: {
    // 保存按钮回调
    handleSave() {
      api.transApi.translate().then(
          response =>{console.log(response);}
      );
    },
  },
};
</script>

<style scoped>
.el-form {
  width: 60%;
}
</style>